//
//  MIDIMyindentCell.m
//  迷笛
//
//  Created by . on 2018/9/11.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIMyindentCell.h"



@implementation MIDIMyindentCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.orderNumber];
        [self.orderNumber mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_offset(WidthScale(10));
            make.left.mas_offset(WidthScale(25));
            [self.orderNumber setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        
        [self addSubview:self.completeState];
        [self.completeState mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.orderNumber);
            make.right.mas_offset(WidthScale(-20));
            [self.completeState setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.notpayState];
        [self.notpayState mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.orderNumber);
            make.right.mas_offset(WidthScale(-20));
            [self.notpayState setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        
        
        [self addSubview:self.mainiamge];
        [self.mainiamge mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.orderNumber.mas_bottom).mas_offset(WidthScale(15));
            make.left.mas_equalTo(WidthScale(25));
            make.width.mas_equalTo(WidthScale(WidthScale(93)));
            make.height.mas_equalTo(kDevice_Is_iPhoneX?HeighX(118):HeightScale(118));
        }];
        
        [self addSubview:self.maintext];
        [self.maintext mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.mainiamge);
            make.left.equalTo(self.mainiamge.mas_right).offset(WidthScale(10));
            [self.maintext setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        
       
        
        
        [self addSubview:self.address];
        [self.address mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.maintext.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.maintext);
            [self.address setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.time];
        [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.address.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.maintext);
            [self.time setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.rmb];
        [self.rmb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.time.mas_bottom).offset(WidthScale(30));
            make.left.equalTo(self.maintext);
            [self.rmb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.price];
        [self.price mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.time.mas_bottom).offset(WidthScale(30));
            make.left.equalTo(self.completeState);
            [self.price setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
    }
    return self;
}

//订单号码
-(UILabel *)orderNumber
{
    if (!_orderNumber)
    {
        _orderNumber =[[UILabel alloc]init];
        _orderNumber.font =[UIFont systemFontOfSize:WidthScale(12)];
        _orderNumber.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
    }
    return _orderNumber;
}

//海报图片
-(UIImageView *)mainiamge
{
    if (!_mainiamge)
    {
        _mainiamge =[[UIImageView alloc]init];
    }
    return _mainiamge;
}
//名称
-(UILabel *)maintext
{
    if (!_maintext)
    {
        _maintext = [[UILabel alloc]init];
        _maintext.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _maintext.font =[UIFont systemFontOfSize:WidthScale(16)];
        _maintext.numberOfLines = 0;
    }
    return _maintext;
}
-(UILabel *)completeState
{
    if (!_completeState)
    {
        _completeState = [[UILabel alloc]init];
        _completeState.textColor = [UIColor colorWithHexString:@"#FF005D"];
        _completeState.font =[UIFont systemFontOfSize:WidthScale(12)];
        _completeState.numberOfLines = 0;
    }
    return _completeState;
}

-(UILabel *)notpayState
{
    if (!_notpayState)
    {
        _notpayState = [[UILabel alloc]init];
        _notpayState.textColor = [UIColor colorWithHexString:@"#FF005D"];
        _notpayState.font =[UIFont systemFontOfSize:WidthScale(12)];
        _notpayState.numberOfLines = 0;
    }
    return _notpayState;
}



//地址
-(UILabel *)address
{
    if (!_address)
    {
        _address = [[UILabel alloc]init];
        _address.textColor = [UIColor colorWithHexString:@"#999999"];
        _address.font =[UIFont systemFontOfSize:WidthScale(12)];
        
    }
    return _address;
}
//时间
-(UILabel *)time
{
    if (!_time)
    {
        _time = [[UILabel alloc]init];
        _time.textColor = [UIColor colorWithHexString:@"#999999"];
        _time.font =[UIFont systemFontOfSize:WidthScale(12)];
        
    }
    return _time;
}
//票价
-(UILabel *)rmb
{
    if (!_rmb)
    {
        _rmb = [[UILabel alloc]init];
        _rmb.font =[UIFont systemFontOfSize:WidthScale(12)];
        _rmb.textColor =[UIColor colorWithHexString:@"#999999"];
    }
    return _rmb;
}
-(UILabel *)price
{
    if (!_price)
    {
        _price =[[UILabel alloc]init];
        _price.font =[UIFont systemFontOfSize:WidthScale(12)];
        _price.textColor =[UIColor colorWithHexString:@"#999999"];
    }
    return _price;
}
@end
